home *** CD-ROM | disk | FTP | other *** search
/ Software Explosion / Software Explosion (Fore-Matt Home Computing)(1996).iso / games / workbench / shuffle / source / source.lha / shuffle_main.c < prev    next >
C/C++ Source or Header  |  1993-05-15  |  2KB  |  95 lines

  1. #include "shuffle.h"
  2.  
  3. long __OSlibversion = 37;
  4. struct shu_data info =
  5.        {
  6.         {
  7.          8,8,
  8.          16,8,
  9.          16,16,
  10.          4,4,
  11.          8,4,
  12.         },
  13.         {
  14.          DIR_UP,DIR_DOWN,
  15.          DIR_DOWN,DIR_UP,
  16.          DIR_LEFT,DIR_RIGHT,
  17.          DIR_RIGHT,DIR_LEFT,
  18.         }, 
  19.         100,80,60,40,20,1,       
  20.         0,
  21.         0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  22.         0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  23.         0,
  24.         0,
  25.         DIR_UP,
  26.         0,
  27.         0,
  28.         100,
  29.         NULL,
  30.         NULL,
  31.         NULL,
  32.         TRUE,
  33.         MODE_TILES,
  34.        };
  35.  
  36.  
  37. /* ------------------------------------------------------------------- */
  38. /*      for cback.o startup */
  39. /* ------------------------------------------------------------------- */
  40.  
  41. long                      __stack        = 8192;
  42. char                      *__procname    = "*shuffle V1.1*";
  43. long                      __priority      = 0L;
  44. long                      __BackGroundIO = 0;
  45. extern BPTR               _Backstdout;
  46.  
  47. /* ----------------------------------------------------------------- */
  48.  
  49. void LoadIcon(int argc, union wbstart argv);
  50.  
  51. void __stdargs main(int argc, union wbstart argv)
  52. {
  53.  int end = FALSE;
  54.  time(&RangeSeed);
  55.  if(!SetupScreen())
  56.  {
  57.   if(!OpenProject0Window())
  58.   {
  59.    info.writeicon = TRUE;
  60.    strcpy(info.f_file,"shuffle.config");
  61.    load_config("env:shuffle.config");
  62.    LoadIcon(argc,argv);
  63.    while(!end)
  64.    {
  65.     WaitPort(Project0Wnd->UserPort);
  66.     if(HandleProject0IDCMP() == FALSE)end = TRUE;
  67.    }
  68.    CloseProject0Window();
  69.   }
  70.   CloseDownScreen();
  71.  } 
  72.  exit(0);
  73. }
  74.  
  75. void LoadIcon(int argc,char **argv)
  76. {
  77.  long i;
  78.  UBYTE fname[256];
  79.  if(!argc)
  80.  {
  81.   if(argv.msg)
  82.   {
  83.    if(argv.msg->sm_NumArgs > 1)
  84.    {
  85.     for(i = 1; i < argv.msg->sm_NumArgs;i++)
  86.     {
  87.      NameFromLock(argv.msg->sm_ArgList[i].wa_Lock,fname,256);
  88.      AddPart(fname,argv.msg->sm_ArgList[i].wa_Name,256);
  89.      load_config(fname);
  90.     }
  91.    }
  92.   }
  93.  }
  94. }
  95.